<?php
/*
 * code to flag project tasks as deleted
*/
if(isset($_SESSION['userid'])){

	// Create connection
	include("../inc_files/utils/dbconnection.php");

	//sanitise the input data
	$taskID = $mysqli->real_escape_string($_POST['taskid']);

	//create query to flag the task as deleted
	$query="UPDATE tasks SET Deleted = 1 WHERE TaskID = '$taskID';";

	//execute query
	$mysqli->query($query) or die($mysqli->error);

	//tidy up database connection
	$mysqli->close();

	echo "success";
} else {
	header("location: /f21na/login.php");
}
?>